<?php
require_once('conn.inc.php');
@$conn	=	mysql_connect($db_host,$db_user,$db_pwd);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);

$id = $_POST['id'];
$sex = $_POST['sex'];

$nname = "UPDATE member SET sex = '$sex' WHERE id = '$id'";
$ru = mysql_query($nname);				
$usql = "select * from member where id= $id ";
$ru	= mysql_query($usql);
$xx= mysql_fetch_array($ru);
$uu = $xx['sex'];

if ($uu !== null) {
	$rc = array('code'=>1);								//成功
	echo json_encode($rc);
}else {
	$rc = array('code'=>0);								//为空
	echo json_encode($rc);
}